<?php
$db=new PDO('mysql:host=localhost','root','12qwas');
$r=$db->exec('create database if not exists db3');
$r=$db->exec('use db3');
$r=$db->exec('create table if not exists students(xh varchar(9) primary key,name varchar(50),age int default 0)');
$r=$db->exec("insert into students(xh,name,age) values ('233110227','王俊达',19)");
var_dump($r);